package com.techsoft.hardwareInfo;

import java.io.IOException;
import java.util.Scanner;

public class Cpu {

	/**
	 * @return CPU的序列号
	 * @throws IOException
	 */
	public static String serial() throws IOException {
		Process process = Runtime.getRuntime().exec(new String[] { "wmic", "cpu", "get", "ProcessorId" });
		process.getOutputStream().close();
		Scanner sc = new Scanner(process.getInputStream());
		try {
			sc.next();
			return sc.next();
		} finally {
			sc.close();
		}
	}

}
